FROM openjdk:8u282-slim

# 设置环境变量
ENV KE_HOME=/opt/kafka-eagle
ENV EAGLE_VERSION=2.0.5

# 拷贝文件到tmp下
COPY kafka-eagle-web-${EAGLE_VERSION}.tar.gz  /tmp

RUN mkdir -p /opt/kafka-eagle/conf
RUN tar zxvf /tmp/kafka-eagle-web-${EAGLE_VERSION}.tar.gz -C /opt/kafka-eagle --strip-components 1 && \
    chmod +x /opt/kafka-eagle/bin/ke.sh && \
    mkdir -p /hadoop/kafka-eagle/db

EXPOSE 8048 8080

COPY system-config.yml /opt/kafka-eagle/conf/system-config.yml
COPY entrypoint.sh /opt/kafka-eagle/bin/entrypoint.sh

# 给启动shell加权限
RUN chmod +x /opt/kafka-eagle/bin/entrypoint.sh
# 工作目录
WORKDIR /opt/kafka-eagle

# 运行启动shell
CMD ["sh", "/opt/kafka-eagle/bin/entrypoint.sh"]